python b to string

30

python b to string -

b'hello'.decode(encoding="utf-8")

bytes to string python -

# utf-8 is used here because it is a very common encoding, but you
# need to use the encoding your data is actually in.
bytes = b'abcde'
bytes.decode("utf-8") 
'abcde'

Comments

Submit
0 Comments